home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
007
/
bwtool01.arc
/
MAKEWIND.SUB
< prev
next >
Wrap
Text File
|
1987-04-16
|
3KB
|
71 lines
'************************** WINDOW SUBROUTINE *************************
SUB MAKEWIND(ULR%,ULC%,LRR%,LRC%,FRAME%,FORE%,BACK%,GROW%,SHADOW%,LABEL$) STATIC
DEFINT A-Z
IF GROW=0 THEN GOSUB STD : GOTO DONE
'-------------------- Growing Window Module ---------------------------
SHADOW=0
X1=ULC+INT((LRC-ULC)/2)
X2=LRC-INT((LRC-ULC)/2)
Y1=ULR+INT((LRR-ULR)/2)
Y2=LRR-INT((LRR-ULR)/2)
NXT: IF X1>ULC THEN X1=X1-3 : IF X1<ULC THEN X1=ULC
IF X2<LRC THEN X2=X2+3 : IF X2>LRC THEN X2=LRC
IF Y1>ULR THEN Y1=Y1-1
IF Y2<LRR THEN Y2=Y2+1
GOSUB SETUP
IF (X1=ULC) AND (X2=LRC) AND (Y1=ULR) AND Y2=(LRR) THEN GOTO DONE ELSE GOTO NXT
DONE: GROW=0
EXIT SUB
'------------------- Regular Window Module ----------------------------
STD: X1=ULC : X2=LRC : Y1=ULR : Y2=LRR
SETUP: ATTR=(BACK AND 7)*16+FORE
IF FRAME=0 THEN GOSUB NOFRAME ELSE ON FRAME GOSUB H1V1,H2V2,H1V2,H2V1
IF LABEL$="" OR LEN(LABEL$)>(LEN(TOP$)-5) THEN GOTO SHADE
MID$(TOP$,2)="["+LABEL$+"]"
SHADE: '---------------------------- Shadow Module ---------------------------
IF SHADOW=0 THEN GOTO MAKE
COL=X1-3 : DAT$=STRING$((X2-X1)+3,32) : BLACK=0
FOR I=Y1 TO (Y2+2)
ROW=I : CALL FASTPRT(DAT$,ROW,COL,BLACK)
NEXT I
SHADOW=0
MAKE: '------------------------ Produce Window Module -----------------------
ROW=Y1-1 : COL=X1-1
CALL FASTPRT(TOP$,ROW,COL,ATTR)
FOR I=Y1 TO Y2
ROW=I : COL=X1-1
CALL FASTPRT(MIDL$,ROW,COL,ATTR)
NEXT I
ROW=Y2+1 : COL=X1-1
CALL FASTPRT(BOTTM$,ROW,COL,ATTR)
RETURN
H1V1: '--------------- Single Line Frame ---------------------
TOP$ =CHR$(218)+STRING$((X2-X1)+1,196)+CHR$(191)
MIDL$ =CHR$(179)+STRING$((X2-X1)+1, 32)+CHR$(179)
BOTTM$=CHR$(192)+STRING$((X2-X1)+1,196)+CHR$(217)
RETURN
H2V2: '--------------- Double Line Frame ----------------------
TOP$ =CHR$(201)+STRING$((X2-X1)+1,205)+CHR$(187)
MIDL$ =CHR$(186)+STRING$((X2-X1)+1, 32)+CHR$(186)
BOTTM$=CHR$(200)+STRING$((X2-X1)+1,205)+CHR$(188)
RETURN
H1V2: '---- Double Vertical, Single Horizontal Line Frame ----
TOP$ =CHR$(214)+STRING$((X2-X1)+1,196)+CHR$(183)
MIDL$ =CHR$(186)+STRING$((X2-X1)+1, 32)+CHR$(186)
BOTTM$=CHR$(211)+STRING$((X2-X1)+1,196)+CHR$(189)
RETURN
H2V1: '---- Double Horizontal, Single Vertical Line Frame ----
TOP$ =CHR$(213)+STRING$((X2-X1)+1,205)+CHR$(184)
MIDL$ =CHR$(179)+STRING$((X2-X1)+1, 32)+CHR$(179)
BOTTM$=CHR$(212)+STRING$((X2-X1)+1,205)+CHR$(190)
RETURN
NOFRAME:'---------------- No Frame ----------------------------
TOP$=SPACE$((X2-X1)+3)
MIDL$=TOP$
BOTTM$=TOP$
RETURN
END SUB